﻿$(document).ready(function () {

    if ($('#DetailsView1_FEED_TYPE').val() == 'Complaint') {
        document.getElementById('FEED_TYPE_div').style.display = 'inline';
    }
    else {
        document.getElementById('FEED_TYPE_div').style.display = 'none';
    }

    if ($('#DetailsView1_FEED_SOLVED').val() == 'resolved') {
        document.getElementById('FEED_SOLVED_div').style.display = 'inline';
    }
    else {
        document.getElementById('FEED_SOLVED_div').style.display = 'none';
    }

    if ($('#DetailsView1_FEED_ESCALATE').val() == 'Yes') {
        document.getElementById('FEED_ESCALATE_div').style.display = 'inline';
    }
    else {
        document.getElementById('FEED_ESCALATE_div').style.display = 'none';
    }

    if ($('#DetailsView1_OMEN_HAS').val() == 'Yes') {
        document.getElementById('OMEN_HAS_div').style.display = 'inline';
    }
    else {
        document.getElementById('OMEN_HAS_div').style.display = 'none';
    }


});

function selFEED_ISSUEChanged() {
    $("#DetailsView1_ttbFEED_ISSUE").val($('#DetailsView1_selFEED_ISSUE').val());
}





function FEED_TYPEChanged(id, tag) {
    //if ($('#DetailsView1_selELEC_STAT').val() == 'Customer lost  have accepted offer with another retailer') {
    if (document.getElementById(tag).value == 'Complaint') {
        document.getElementById(id).style.display = 'inline';
    }
    else {
        document.getElementById(id).style.display = 'none';
    }

}

function FEED_SOLVEDChanged(id, tag) {
    if (document.getElementById(tag).value == 'resolved') {
        document.getElementById(id).style.display = 'inline';
    }
    else {
        document.getElementById(id).style.display = 'none';
    }

}


function FEED_ESCALATEChanged(id, tag) {
    if (document.getElementById(tag).value == 'Yes') {
        document.getElementById(id).style.display = 'inline';
    }
    else {
        document.getElementById(id).style.display = 'none';
    }

}

function OMEN_HASChanged(id, tag) {
    if (document.getElementById(tag).value == 'Yes') {
        document.getElementById(id).style.display = 'inline';
    }
    else {
        document.getElementById(id).style.display = 'none';
    }

}

function CopyCIChanged() {

    document.getElementById('DetailsView1_USERID').value = document.getElementById('DetailsView1_FormView1_USERIDLabel').innerText;
    document.getElementById('DetailsView1_TITLE').value = document.getElementById('DetailsView1_FormView1_TITLELabel').innerText;
    document.getElementById('DetailsView1_FIRSTNAME').value = document.getElementById('DetailsView1_FormView1_FIRST_NAMELabel').innerText;
    document.getElementById('DetailsView1_LASTNAME').value = document.getElementById('DetailsView1_FormView1_LAST_NAMELabel').innerText;
    document.getElementById('DetailsView1_COMPANY_NAME').value = document.getElementById('DetailsView1_FormView1_COMPANY_NAMELabel').innerText;
    document.getElementById('DetailsView1_EMAIL').value = document.getElementById('DetailsView1_FormView1_EMAILLabel').innerText;
    document.getElementById('DetailsView1_PHONE').value = document.getElementById('DetailsView1_FormView1_BPHONELabel').innerText;
    document.getElementById('DetailsView1_MOBILE').value = document.getElementById('DetailsView1_FormView1_MOBILELabel').innerText;
    document.getElementById('DetailsView1_FAX').value = document.getElementById('DetailsView1_FormView1_FAXLabel').innerText;
    document.getElementById('DetailsView1_ADDRESS').value = document.getElementById('DetailsView1_FormView1_NOTICE_ADDRESSLabel').innerText;
    document.getElementById('DetailsView1_SUBURB').value = document.getElementById('DetailsView1_FormView1_NOTICE_SUBURBLabel').innerText;
    document.getElementById('DetailsView1_STATE').value = document.getElementById('DetailsView1_FormView1_NOTICE_STATELabel').innerText;
    document.getElementById('DetailsView1_POSTCODE').value = document.getElementById('DetailsView1_FormView1_NOTICE_POSTCODELabel').innerText;

}


function CopyRSChanged() {

    document.getElementById('DetailsView1_USERID').value = document.getElementById('DetailsView1_FormView2_UserIDLabel').innerText;
    document.getElementById('DetailsView1_TITLE').value = document.getElementById('DetailsView1_FormView2_FirstAccountHolderTitleLabel').innerText;
    document.getElementById('DetailsView1_FIRSTNAME').value = document.getElementById('DetailsView1_FormView2_FirstNameLabel').innerText;
    document.getElementById('DetailsView1_LASTNAME').value = document.getElementById('DetailsView1_FormView2_LastNameLabel').innerText;
    document.getElementById('DetailsView1_COMPANY_NAME').value = document.getElementById('DetailsView1_FormView2_CompanyNameLabel').innerText;
    document.getElementById('DetailsView1_EMAIL').value = document.getElementById('DetailsView1_FormView2_EmailLabel').innerText;
    document.getElementById('DetailsView1_PHONE').value = document.getElementById('DetailsView1_FormView2_PhoneLabel').innerText;
    document.getElementById('DetailsView1_MOBILE').value = document.getElementById('DetailsView1_FormView2_MobileLabel').innerText;
    document.getElementById('DetailsView1_FAX').value = document.getElementById('DetailsView1_FormView2_FaxLabel').innerText;
    document.getElementById('DetailsView1_ADDRESS').value = document.getElementById('DetailsView1_FormView2_StreetLabel').innerText;
    document.getElementById('DetailsView1_SUBURB').value = document.getElementById('DetailsView1_FormView2_SuburbLabel').innerText;
    document.getElementById('DetailsView1_STATE').value = document.getElementById('DetailsView1_FormView2_StateNameLabel').innerText;
    document.getElementById('DetailsView1_POSTCODE').value = document.getElementById('DetailsView1_FormView2_PostcodeLabel').innerText;

}



function FEED_TYPEChanged(id, tag) {
    //if ($('#DetailsView1_selELEC_STAT').val() == 'Customer lost  have accepted offer with another retailer') {
    if (document.getElementById(tag).value == 'Complaint') {
        document.getElementById(id).style.display = 'inline';
    }
    else {
        document.getElementById(id).style.display = 'none';
    }

}